fix(bundler): resolve built-in step types when checking bundle component references - #3885
Open
jawwad-ali wants to merge 2 commits into
Open
fix(bundler): resolve built-in step types when checking bundle component references#3885jawwad-ali wants to merge 2 commits into
jawwad-ali wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes bundle validation for built-in workflow step references.
Changes:
- Resolves step IDs found in
STEP_REGISTRY. - Adds built-in and unknown-step regression tests.
- Blocking issue:
STEP_REGISTRYalso contains custom steps loaded from other projects.
Show a summary per file
| File | Description |
|---|---|
src/specify_cli/bundler/services/references.py |
Adds step registry resolution. |
tests/unit/test_bundler_references.py |
Tests built-in and unknown step references. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Balanced
…nces `_resolved_locally` gives three of the four component kinds a "is it bundled with Spec Kit?" check before the installed-in-project one: presets -> _locate_bundled_preset or PresetManager.get_pack extensions -> _locate_bundled_extension or ExtensionManager...is_installed workflows -> _locate_bundled_workflow or WorkflowRegistry.is_installed steps -> StepRegistry.is_installed <-- no bundled check `StepRegistry` tracks *community* step types installed under `.specify/workflows/steps/`. Spec Kit ships 11 step types as built-ins registered in `STEP_REGISTRY`, so every one of them looked unresolved: steps/shell -> False steps/gate -> False steps/command -> False steps/if -> False A bundle declaring a dependency on any built-in step type was therefore reported as an unresolved reference — an error online, a warning offline. There is no `_locate_bundled_step` to mirror, because step types are not an on-disk asset directory; `STEP_REGISTRY` is the equivalent check, and is what `specify workflow step info` reports as "built-in". Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…egistry Review catch: `STEP_REGISTRY` is not limited to bundled steps. `load_custom_steps` adds project-installed ids to that process-global mapping and never removes them, so in a long-lived process a community step loaded while working on project A would be accepted as "bundled" when validating a bundle for project B — before B's own StepRegistry is consulted. Snapshot the shipped ids into `BUILTIN_STEP_TYPES` immediately after `_register_builtin_steps()`, before `load_custom_steps` is even defined, and check that frozenset instead. Verified: with the check on STEP_REGISTRY the new cross-project test fails (a leaked community id resolves as bundled); with BUILTIN_STEP_TYPES it passes. 1 failed, 5 passed -> 6 passed. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
jawwad-ali
force-pushed
the
fix/bundler-builtin-step-references
branch
from
July 31, 2026 17:43
d99b4bb to
bb16911
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
_resolved_locallyinsrc/specify_cli/bundler/services/references.pygives three of the four component kinds a "is it bundled with Spec Kit?" check before the installed-in-project check.stepsis the exception:presets_locate_bundled_presetPresetManager(root).get_packextensions_locate_bundled_extensionExtensionManager(root).registry.is_installedworkflows_locate_bundled_workflowWorkflowRegistry(root).is_installedstepsStepRegistry(root).is_installedStepRegistrytracks community step types installed under.specify/workflows/steps/. Spec Kit ships 11 step types as built-ins registered inSTEP_REGISTRY.Reproduction on current
main(81bf741)So a bundle that declares a dependency on any built-in step type is reported as an unresolved reference — a hard error with
--allow-network, a warning offline. Those are exactly the step types a bundle is most likely to depend on.Fix
There is no
_locate_bundled_stepto mirror, because step types are not an on-disk asset directory — they are registered in code.STEP_REGISTRYis the bundled-with-Spec-Kit check for this kind, and it is whatspecify workflow step infoalready reports as "built-in":The import stays lazy and inside the function, matching every other branch. Importing
specify_cli.workflowsruns_register_builtin_steps(), exactly asworkflow step inforelies on.No breaking change. This only makes previously-unresolvable ids resolve. A second new test pins that an unknown step id (
no-such-step-type) still errors, so the guard has not made everything resolve.Verification
test_builtin_step_type_resolvesfails on unpatchedsrcand passes with the fix. File: 1 failed → 5 passed.tests/unit: failure set identical to the clean-mainbaseline captured on81bf741(2 pre-existing in scope).uvx ruff@0.15.0 check src tests→ cleanTests sit beside
test_bundled_extension_resolves, the exact sibling assertion for the bundled-with-Spec-Kit case.Written with assistance from Claude Code. Bug found, reproduced, and verified by me on current
main.